package com.example.custom.rpc.loadbalance;


import com.example.custom.rpc.common.URL;

import java.util.List;
import java.util.Random;

/**
 * @author liyuncong
 * @version 1.0
 * @file LoadBalance
 * @brief LoadBalance
 * @details LoadBalance
 * @date 2022-11-06
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                     NAME               DESCRIPTION
 * 2022-11-06               liyuncong          Created
 */
public class LoadBalance {

    public static URL random(List<URL> urls) {
        Random random = new Random();
        final int i = random.nextInt(urls.size());
        return urls.get(i);
    }
}
